/**
 * Project Name:renshuaipeng-parent
 * File Name:IndexController
 * Package Name:ren.renshuaipeng.search.web
 * Date:15-12-13
 * Copyright (c) 2015, niao.shuai123@163.com All Rights Reserved.
 */

package ren.renshuaipeng.util.search.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ren.renshuaipeng.util.search.service.TestService;

/**
 * ClassName:IndexController <br/>  
 * Function: 首页. <br/>
 * Date:     15-12-13 <br/>  
 * @author 任帅鹏（作者）
 * @version V1.00 （版本号）  
 * @since JDK 1.8  
 * @see
 */
@Controller
public class IndexController {

    @Autowired
    private TestService testService;

    /**
     *
     * @Name: index
     * @Description: 首页
     * @Author 任帅鹏（作者）
     * @Version V1.00 （版本号）
     * @Create Date: 15-12-13（创建日期）
     * @Parameters:[]
     * @Return java.lang.String
     * @Throws
     */
    @RequestMapping("/")
    public String index(Model model, @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,
                                     @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
        model.addAttribute("page",testService.findAll(pageNum,pageSize));
        return "index";
    }
}
